<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('招聘计划列表')" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>招聘名称：</label>
                            <select id="recruitId" name="recruitId" class="form-control">
                                <option value="0">所有</option>
                                <option th:each="info : ${infos}" th:text="${info['recruitName']}" th:value="${info['recruitId']}"></option>
                            </select>
                        </li>
                        <li>
                            <label>招聘年度：</label>
                            <input type="text" name="recruitYear"/>
                        </li>
                        <li>
                            <label>岗位名称：</label>
                            <input type="text" name="postName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="recruit:report:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
    var subjectTypeDatas = [[${@dict.getType('basic_subject_type')}]];
    var educateTypeDatas = [[${@dict.getType('basic_educate_name')}]];
    var degreeTypeDatas = [[${@dict.getType('basic_educate_degree')}]];
    var prefix = ctx + "recruit/report";

    $(function() {
        var options = {
            url: prefix + "/list",
            exportUrl: prefix + "/export",
            modalName: "空岗内容",
            columns: [{
                checkbox: true
            },
                {
                    field: 'contentId',
                    title: '内容id',
                    visible: false
                },
                {
                    field: 'recruitName',
                    title: '招聘名称'
                },
                {
                    field: 'postName',
                    title: '岗位名称'
                },
                {
                    field: 'postCode',
                    title: '岗位代码'
                },
                {
                    field: 'postLevel',
                    title: '岗位层次'
                },
                {
                    field: 'subjectType',
                    title: '科目',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(subjectTypeDatas, value);
                    }
                },
                {
                    field: 'educateType',
                    title: '最低学历要求',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(educateTypeDatas, value);
                    }
                },
                {
                    field: 'degreeType',
                    title: '最低学位要求',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(degreeTypeDatas, value);
                    }
                },
                {
                    field: 'major',
                    title: '硕士专业要求'
                },
                {
                    field: 'major1',
                    title: '本科专业要求'
                },
                {
                    field: 'planNumber',
                    title: '招聘计划人数'
                },
                {
                    field: 'confirmCount',
                    title: '实际到岗人数'
                },
                {
                    field: 'other',
                    title: '其他要求'
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>